package cn.magic.controller;

import cn.magic.User;
import cn.magic.feign.UserFeignClient;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
// 构造器注入
@AllArgsConstructor
public class OrderController {
    // 相当于@Autowired
    private UserFeignClient userFeignClient;

    @GetMapping("/getById/{id}")
    public User getByUserId(@PathVariable Long id){
        return userFeignClient.getByUserId(id);
    }

}
